// 1.首先要引入相应的模块
// require或是ES6中的import 会将引入进来的json文件直接转换成真正的数组或对象
import banner from "./banner.json";
import floors from "./floors.json";
import Mock from "mockjs";
import axios from "axios";

// 2.开启mock服务器
Mock.mock("/mock/banner", "get", { code: 200, message: "Ok", data: banner });
Mock.mock("/mock/floors", "get", { code: 200, message: "Ok", data: floors });

// 3.在这里测试一下
// axios.get("/mock/banner").then(
//   (response) => {
//     console.log("mock", response);
//   },
//   (error) => {
//     console.log(error);
//   }
// );
